Skip to content

Conversation

@kayaercument
Copy link
Collaborator

@kayaercument kayaercument commented Mar 24, 2025

Description

This PR bundles the required implementations to retrieve environmental telemetry data using QDMI.

Checklist

  • The pull request only contains commits that are related to it.
  • Documentation and tests are created
  • The project's style is followed.

Closes: #152

Documentation will be created after details and naming are finalised.

@burgholzer
Copy link
Contributor

Hey @kayaercument 👋🏼
Thanks for this initial proposal!
In order to evaluate its feasibility, could you please also add tests for the new feature that show it in action? (Very similar to what we already have for the existing functionality)
Code that compiles and "does something" is much easier to judge than a simple interface addition.
We will definitely need some bike shedding on the naming scheme, but I think that is inevitable anyway and should be a simple refactor in any case.
This looks like a solid start!

(I think I can fix the coverage uploads from forks not working. let me check)

@burgholzer burgholzer added minor Changes that warrant a minor version release feature New feature or feature request labels Mar 24, 2025
Copy link
Collaborator

@mnfarooqi mnfarooqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kayaercument
Here are a few minor comments while you are working on the tests.

@kayaercument
Copy link
Collaborator Author

Dear @echavarria-lrz and @burgholzer,

Please review the work. I will write the documentation after everything is finalised.

@mnfarooqi mnfarooqi requested a review from burgholzer April 10, 2025 11:19
Copy link
Collaborator

@ystade ystade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kayaercument thanks for the proposal of integrating the query of environmental data into QDMI. I took the liberty and added few questions inline in the code. Those are open questions more on the fundamental side. Hence, I think it makes sense to find an asnwer to them first, before I or someone else goes through the code in detail.

Overall, all additions fit niceliy with the look and feel of QDMI. Just one minor point: Already for a review of the code, doxygen comments help a lot to understand what the functions are supposed to do. However, since you did not actively request a review and I just voluntarily took a look, I cannot really complain.

@burgholzer burgholzer added this to the v1.2.0 milestone May 2, 2025
@kayaercument
Copy link
Collaborator Author

Hey @burgholzer and @ystade,

I and @mnfarooqi wanted to try use_oidc for the codecov report. However, it does not trigger. Could you please check?

@burgholzer
Copy link
Contributor

Hey @burgholzer and @ystade,

I and @mnfarooqi wanted to try use_oidc for the codecov report. However, it does not trigger. Could you please check?

Yeah. Something seems to be broken with CI at the moment. I'll check.
Just fyi: we previously used OIDC for codecov already, but that didn't work either for forks and is unlikely to work because a fork does not have the right permissions to create a valid OIDC token for the main repository. Codecov actually tries to use the tokenless upload in these cases. However, it seems that something is messed up in some configuration which is why it still expects a token in these cases. Eventually, we might have to open a support ticket with them as it might very well be an issue that only they can fix.

@burgholzer burgholzer mentioned this pull request Sep 17, 2025
8 tasks
@burgholzer
Copy link
Contributor

CI is running again now. For some reason, the CI workflow was disabled 🤷🏼

@mnfarooqi
Copy link
Collaborator

Hey @burgholzer and @ystade,
I and @mnfarooqi wanted to try use_oidc for the codecov report. However, it does not trigger. Could you please check?

Yeah. Something seems to be broken with CI at the moment. I'll check. Just fyi: we previously used OIDC for codecov already, but that didn't work either for forks and is unlikely to work because a fork does not have the right permissions to create a valid OIDC token for the main repository. Codecov actually tries to use the tokenless upload in these cases. However, it seems that something is messed up in some configuration which is why it still expects a token in these cases. Eventually, we might have to open a support ticket with them as it might very well be an issue that only they can fix.

It may be something to do with the settings in Codecov? For example:
https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token

@burgholzer
Copy link
Contributor

Hey @burgholzer and @ystade,
I and @mnfarooqi wanted to try use_oidc for the codecov report. However, it does not trigger. Could you please check?

Yeah. Something seems to be broken with CI at the moment. I'll check. Just fyi: we previously used OIDC for codecov already, but that didn't work either for forks and is unlikely to work because a fork does not have the right permissions to create a valid OIDC token for the main repository. Codecov actually tries to use the tokenless upload in these cases. However, it seems that something is messed up in some configuration which is why it still expects a token in these cases. Eventually, we might have to open a support ticket with them as it might very well be an issue that only they can fix.

It may be something to do with the settings in Codecov? For example: https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token

By now I tripple checked all settings across the GitHub repository, the GitHub organization as well as codecov. They perfectly match a known-good setup we use over at the MQT where codecov reports from forks work just fine without any special handling.
At this point I am 99% sure this will require a support ticket with codecov.

Copy link
Collaborator

@ystade ystade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kayaercument
@burgholzer asked me wether I can do another round of review as he couldn't find the time to do so. Hence, I started and got until the middle of the file include/qdmi/client.h (from the top in the "Files Changed" overview). Here in this file I realized that you do not seem to be done with the PR as a lot of my last comments lack a reaction. Consequently, I stopped in the middle and will wait for your ping when you wnt through the feedback. Thanks for the effort.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burgholzer What is the latest state here regarding the CodeCov setup? Should these changes be reverted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current state is #154 (comment)

We should not need to explicitly set any secrets or tokens in workflows here. Any respective changes can be reverted here or should be moved to a separate PR that gets merged before this PR does.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is reverted. Have any support tickets been created?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Would you mind creating one?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same holds for this file as commented above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is reverted.

param != QDMI_DEVICE_TELEMETRYSENSOR_QUERY_PARAMETER_CUSTOM3 &&
param != QDMI_DEVICE_TELEMETRYSENSOR_QUERY_PARAMETER_CUSTOM4 &&
param != QDMI_DEVICE_TELEMETRYSENSOR_QUERY_PARAMETER_CUSTOM5) ||
value == nullptr || (size != sizeof(decltype(query->start_time)))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value == nullptr || (size != sizeof(decltype(query->start_time)))) {
value == nullptr) {

The check (size != sizeof(decltype(query->start_time))) must be placed somewhere differently because also other information than of the start_time's type can be returned, e.g., a sensor pointer. This check should be handled in the respective cases.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected.

Comment on lines 106 to 132
decltype(QDMI_device_session_query_telemetrysensor_property)
*device_session_query_telemetrysensor_property{};

decltype(QDMI_device_telemetrysensor_query_set_parameter)
*device_telemetrysensor_query_set_parameter{};

decltype(QDMI_device_session_create_device_telemetrysensor_query)
*device_session_create_device_telemetrysensor_query{};

decltype(QDMI_device_telemetrysensor_query_submit)
*device_telemetrysensor_query_submit{};

decltype(QDMI_device_telemetrysensor_query_get_results)
*device_telemetrysensor_query_get_results{};

decltype(QDMI_device_telemetrysensor_query_check_status)
*device_telemetrysensor_query_check_status{};

decltype(QDMI_device_telemetrysensor_query_wait)
*device_telemetrysensor_query_wait{};

decltype(QDMI_device_telemetrysensor_query_cancel)
*device_telemetrysensor_query_cancel{};

decltype(QDMI_device_telemetrysensor_query_free)
*device_telemetrysensor_query_free{};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding docstrings similar to the lines above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is added.

* Additionally, the size of the buffer needed to retrieve the property is
* returned in @p size_ret if @p size_ret is not @c NULL.
*
* @note For example, to query the unit of an telemetry sensor, the following
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @note For example, to query the unit of an telemetry sensor, the following
* @note For example, to query the unit of a telemetry sensor, the following

As mentioned above, please also check the rest.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

* returned in @p size_ret if @p size_ret is not @c NULL.
*
* @note For example, to query the unit of an telemetry sensor, the following
code pattern
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again a weird line break.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

* size_t telemetrysensor_unit_size = 0;
* auto ret = QDMI_device_query_telemetrysensor_property(
* device, telemetry_sensor, QDMI_TELEMETRYSENSOR_PROPERTY_UNIT, 0,
nullptr,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check for all other weird line breaks and fix them.

/** @defgroup client_telemetrysensor_query_interface \
* QDMI Client Telemetry Sensor Query Interface
* @brief Provides functions to query telemetry sensors.
* @details An telemetry sensor query is a task submitted by a client to a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @details An telemetry sensor query is a task submitted by a client to a
* @details A telemetry sensor query is a task submitted by a client to a

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected.

Comment on lines 1091 to 1092
* @see QDMI_Device_TelemetrySensor_Query for the device-side the telemetry
* sensor query handle.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coud it be that there is one the too many?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 52 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
examples/device/device.cpp 67.5% 38 Missing ⚠️
examples/driver/qdmi_example_driver.cpp 73.0% 14 Missing ⚠️

❌ Your patch check has failed because the patch coverage (75.0%) is below the target coverage (90.0%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (85.9%) is below the adjusted base coverage (88.6%). You can increase the head coverage or adjust the Removed Code Behavior.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #154     +/-   ##
=========================================
- Coverage     89.1%   85.9%   -3.3%     
=========================================
  Files            6       6             
  Lines          712     920    +208     
  Branches       140     170     +30     
=========================================
+ Hits           635     791    +156     
- Misses          77     129     +52     
Flag Coverage Δ
cpp 85.9% <75.0%> (-3.3%) ⬇️
Files with missing lines Coverage Δ
examples/fomac/example_fomac.cpp 81.3% <100.0%> (+5.4%) ⬆️
examples/fomac/example_fomac.hpp 100.0% <ø> (ø)
examples/driver/qdmi_example_driver.cpp 85.9% <73.0%> (-3.6%) ⬇️
examples/device/device.cpp 87.3% <67.5%> (-6.7%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@burgholzer burgholzer modified the milestones: v1.2.0, v1.3.0 Nov 19, 2025
@burgholzer
Copy link
Contributor

I am moving this to the 1.3.0 milestone for now as there still seems to be ongoing discussions that need to be resolved and the changes on main have been pretty stable for a while.

@burgholzer burgholzer removed their request for review December 13, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or feature request minor Changes that warrant a minor version release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Support for Querying Environment Sensor Data

6 participants